package com.wanwan.websocket;

import cn.stylefeng.roses.core.config.MybatisDataSourceAutoConfiguration;
import com.wanwan.websocket.server.WebSocketServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication(exclude = {MybatisDataSourceAutoConfiguration.class})
@MapperScan(basePackages = {"com.wanwan.websocket.mapper"})
public class WebSocketApplication {
    public static void main(String[] args) {
        //解决springboot和websocket之间使用@autowired注入为空问题
        ConfigurableApplicationContext applicationContext = SpringApplication.run(WebSocketApplication.class, args);
        //这里将Spring Application注入到websocket类中定义的Application中。
        WebSocketServer.setApplicationContext(applicationContext);
        new SecurityXMLServer();


    }
}
